tune distro mode
authorAndreas Beckmann <anbe@debian.org>
Tue, 16 Feb 2021 10:00:57 +0000 (10:00 +0000)
committerAndreas Beckmann <anbe@debian.org>
Tue, 16 Feb 2021 10:00:57 +0000 (10:00 +0000)
Forwarded: no-needed

Gbp-Pq: Name distro.patch

CMakeLists.txt
lib/kernel/host/CMakeLists.txt

index 29508bc9706e970c12efdd3070bd4084efb351d8..b5c6bc0afa4fc3c827641fb7fa16853567c29bf1 100644 (file)
@@ -1047,6 +1047,9 @@ endif()
 
 set(KERNELLIB_HOST_DISTRO_VARIANTS 0)
 if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
+  if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+    set(HOST_CPU_FORCED 0 CACHE INTERNAL "CPU is forced by user")
+  endif()
   if(HOST_CPU_FORCED)
     message(FATAL_ERROR "Cannot build with CPU autodetection distro variants build, and enforce LLC_HOST_CPU at the same time. Please pick one")
   endif()
@@ -1057,6 +1060,9 @@ if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
   else()
     message(FATAL_ERROR "Don't know what CPU variants to use for kernel library on this platform.")
   endif()
+  if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+    list(INSERT KERNELLIB_HOST_CPU_VARIANTS 0 ${LLC_HOST_CPU})
+  endif()
   set(KERNELLIB_HOST_DISTRO_VARIANTS 1)
 endif()
 
index 12c193501f08d7033412852d449a160c058e6609..3d25fd4b673de4d81bd60fc952389d4d5a34bc3b 100644 (file)
@@ -317,8 +317,8 @@ separate_arguments(DEVICE_C_FLAGS)
 function(x86_distro_variant_to_flags VARIANT OUT_LLC_FLAGS OUT_CLANG_FLAGS)
 
   if("${VARIANT}" STREQUAL "sse2")
-    set(CLANG_F "${CLANG_MARCH_FLAG}athlon64")
-    set(LLC_F "-mcpu=athlon64")
+    set(CLANG_F "${CLANG_MARCH_FLAG}x86-64")
+    set(LLC_F "-mcpu=x86-64")
 
   elseif("${VARIANT}" STREQUAL "ssse3")
     set(CLANG_F "${CLANG_MARCH_FLAG}core2")